<template>
  <div>
    <button v-for="b in buttons" :key="b" v-text="b + label"></button>
    <el-button @click="update1">子组件</el-button>
    <slot :update1="update1" :buttons="buttons" ></slot>
  </div>
</template>

<script>
// import New from './components/New.vue';
export default {
  name: "Son",
  components: {
    // New,Old,
  },
  props: {
    sampleP: {
      type: Number,
      default: 0,
    },
    label: String,
    blank: {
      type: Function,
    },
  },
  data() {
    return {
      sampleD: "value",
      buttons: ["按钮1号", "按钮2号", "按钮3号", "按钮4号"],
    };
  },
  computed: {
    // sampleC() {
    //     return this.sampleD+'--';
    // }
  },
  created() {},
  mounted() {},
  methods: {
    sampleM() {},
    update1() {
      this.buttons.push("新的按钮");
      // this.$bus.$emit("anyQueue",{name:'zhangsan',age:'lisi'})
      // this.$emit("click");
      // this.$emit("changeEventContainer");
      // this.$emit("aaaa", "good");
      // this.$emit("bbb");
      // this.$emit("queue1")
      // this.$emit("list1")
      // this.$emit("list2")
      // this.$emit("shanxiribao",{name:'zhangsan',age:'lisi'},this.buttons)

      //试着去运行@click=method1  method1
      // this.blank();
      // this.$parent.changeButtonName();
      this.buttons.push("二新按钮");

      //this.$parent.changeButtonName is not a function
      //: Error in v-on handler: "TypeError: this.blank is not a function"

      // that.
    },
  },
  watch: {
    // sampleC(newValue, oldValue) {
    //
    // }
  },
};
</script>

<!--<style scoped>-->
<style lang="scss" scoped></style>
